// see http://vuejs-templates.github.io/webpack for documentation.
var path = require("path");
// var baseurl='http://192.168.0.8:8765'
module.exports = {
    // transpileDependencies: ['@xdh/my'],
    // chainWebpack(chain) {
    //   chain.resolve.alias.set('$ui', '@xdh/my/ui/lib')
    // },
    // publicPath: "/schedule",
    build: {
        sitEnv: require("./sit.env"),
        prodEnv: require("./prod.env"),
        index: path.resolve(__dirname, "../dist/index.html"),
        assetsRoot: path.resolve(__dirname, "../dist"),
        assetsSubDirectory: "static",
        assetsPublicPath: "./", //请根据自己路径配置更改 ./
        productionSourceMap: false,
        // Gzip off by default as many popular static hosts such as
        // Surge or Netlify already gzip all static assets for you.
        // Before setting to `true`, make sure to:
        // npm install --save-dev compression-webpack-plugin
        productionGzip: false,
        productionGzipExtensions: ["js", "css"],
        // Run the build command with an extra argument to
        // View the bundle analyzer report after build finishes:
        // `npm run build --report`
        // Set to `true` or `false` to always turn it on or off
        bundleAnalyzerReport: process.env.npm_config_report,
    },
    dev: {
        env: require("./dev.env"),
        port: 9528,
        autoOpenBrowser: true,
        assetsSubDirectory: "static",
        assetsPublicPath: "/",
        proxyTable: {
            "/jwt": {
                // target: 'http://192.168.2.21:8765',
                // target: 'http://localhost:8765',
                target: "http://140.249.214.1:8765",
                // target: "http://192.168.2.46:8765",
                pathRewrite: {
                    "^/jwt": "/jwt",
                },
            },
            "/api": {
                // target: 'http://192.168.2.21:8765',
                // target: "http://192.168.2.46:8765",

                // target: 'http://localhost:8765',
                target: "http://140.249.214.1:8765",
                pathRewrite: {
                    "^/api": "/api",
                },
            },
            //配置其他代理地址_NBIOT参数配置
            "/flNbIot": {
                target: "http://150.138.119.4:8767",
                pathRewrite: {
                    "^/flNbIot": "/flNbIot",
                },
            },
            //订阅管理
            "/flProductModel": {
                target: "http://150.138.119.4:8767",
                pathRewrite: {
                    "^/flProductModel": "/flProductModel",
                },
            },
            //订阅管理
            "/flSubscripteManage": {
                target: "http://150.138.119.4:8767",
                pathRewrite: {
                    "^/flSubscripteManage": "/flSubscripteManage",
                },
            },
            //订单管理
            "/flOrderManagement": {
                target: "http://150.138.119.4:8769",
                pathRewrite: {
                    "^/flOrderManagement": "/flOrderManagement",
                },
            },
            //生产批次管理
            //订单监控
            "/flOrderManagement": {
                target: "http://150.138.119.4:8769",
                pathRewrite: {
                    "^/flOrderManagement": "/flOrderManagement",
                },
            },
            //订单管理
            "/flBatch": {
                target: "http://150.138.119.4:8769",
                pathRewrite: {
                    "^/flBatch": "/flBatch",
                },
            },
            //水表管理
            "/flBusinessSore": {
                target: "http://150.138.119.4:8769",
                pathRewrite: {
                    "^/flBusinessSore": "/flBusinessSore",
                },
            },
            ///经销商出货管理
            "/flSdealerChubill": {
                target: "http://150.138.119.4:8769",
                pathRewrite: {
                    "^/flSdealerChubill": "/flSdealerChubill",
                },
            },
            //出库单查询
            "/flSoreBill": {
                target: "http://150.138.119.4:8769",
                pathRewrite: {
                    "^/flSoreBill": "/flSoreBill",
                },
            },
            //flSdealerRubill出库
            "/flSdealerRubill": {
                target: "http://150.138.119.4:8769",
                pathRewrite: {
                    "^/flSdealerRubill": "/flSdealerRubill",
                },
            },
            // 测试管理 / 模组测试管理
            // '/flModuleManage':{
            //   target: 'http://150.138.119.4:8769',
            //   pathRewrite: {
            //     '^/flModuleManage': '/flModuleManage'
            //   },
            // },
            //日志记录
            "/flHistoryTool": {
                target: "http://192.168.2.14:8803",
                pathRewrite: {
                    "^/flHistoryTool": "/flHistoryTool",
                },
            },
            //平台字典管理（左）
            "/tSTypegroup": {
                target: "http://192.168.0.9:8803",
                pathRewrite: {
                    "^/tSTypegroup": "/tSTypegroup",
                },
            },
            //平台字典管理（右）
            "/tSType": {
                target: "http://192.168.0.9:8803",
                pathRewrite: {
                    "^/tSType": "/tSType",
                },
            },
            //NB设备管理
            "/flNbDevices": {
                target: "http://150.138.119.4:8767",
                pathRewrite: {
                    "^/flNbDevices": "/flNbDevices",
                },
            },
            //4.1.1.2 定时任务运行监控
            "/sysjobvo": {
                target: "http://192.168.2.28:8769",
                pathRewrite: {
                    "^/sysjobvo": "/sysjobvo",
                },
            },

            //生命周期 flLifeCycle
            "/flLifeCycle": {
                target: "http://150.138.119.4:8769",
                pathRewrite: {
                    "^/flLifeCycle": "/flLifeCycle",
                },
            },
            //菜单管理baseMenu
            "/baseMenu": {
                target: "http://192.168.2.14:8762",
                pathRewrite: {
                    "^/baseMenu": "/baseMenu",
                },
            },
            //查询菜单按钮 baseElement
            "/baseElement": {
                target: "http://192.168.2.14:8762",
                pathRewrite: {
                    "^/baseElement": "/baseElement",
                },
            },
            //添加的按钮 element
            "/element": {
                target: "http://192.168.2.14:8762",
                pathRewrite: {
                    "^/element": "/element",
                },
            },
            //租户分布图baseTenantInformation
            "/baseTenantInformation": {
                target: "http://192.168.2.14:8762",
                pathRewrite: {
                    "^/baseTenantInformation": "/baseTenantInformation",
                },
            },
        },
        // CSS Sourcemaps off by default because relative paths are "buggy"
        // with this option, according to the CSS-Loader README
        // (https://github.com/webpack/css-loader#sourcemaps)
        // In our experience, they generally work as expected,
        // just be aware of this issue when enabling this option.
        cssSourceMap: false,
    },
};